import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collection;

/**
 * Created with IntelliJ IDEA.
 * User: thoughtworker
 * Date: 10/10/13
 * Time: 4:43 PM
 * To change this template use File | Settings | File Templates.
 */
public class StartApp {

    private League league;
    private playerRepository playerRepo;

    public static Collection buildPlayerRepository() {
        Collection<Player> listOfPlayers = new ArrayList<Player>();
        listOfPlayers.add(new Player("Ryan", "Bears", 9, 28));
        listOfPlayers.add(new Player("Julia", "Tigers", 10, 25));
        listOfPlayers.add(new Player("Alexa", "Tigers", 1, 24));
        return listOfPlayers;
    }

    public static Collection buildCoachRepository() {
        Collection<Coach> listOfCoaches = new ArrayList<Coach>();
        listOfCoaches.add(new Coach("Coach Bill", "Bears"));
        listOfCoaches.add(new Coach("Coach Charlie", "Lions"));
        return listOfCoaches;
    }

    public static void main(String[] args) throws IOException {
        League league = new League(System.out, buildPlayerRepository(), buildCoachRepository());
        MenuHandler menuHandler = new MenuHandler(System.out, new BufferedReader(new InputStreamReader(System.in)), league);
        menuHandler.displayMenu();
        menuHandler.respondToUserInputOnMainMenu(menuHandler.grabUserInput());
    }

}
